package com.bckj.fastboot.paid.biz.application.service;

import com.bckj.fastboot.paid.api.model.PayRequest;
import com.bckj.fastboot.paid.api.model.PayResponse;
import com.bckj.fastboot.paid.biz.domain.pay.context.PayContext;
import com.bckj.fastboot.paid.biz.domain.pay.service.PayOrderDomainService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class PayService {

    private final PayOrderDomainService payOrderDomainService;

    public PayResponse pay(PayRequest request) {
        var ctx = PayContext.create();
        ctx.setRequest(request);
        payOrderDomainService.pay(ctx);
        return ctx.getResponse();
    }
}
